#include <bits/stdc++.h>
using namespace std;

int main() {
  string x, y;
  cin >> x >> y;

  if (x == "Lynx") {
    x = "Z" + x;
  }

  if (y == "Lynx") {
    y = "Z" + y;
  }

  if (x >= y) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}